package com.zhan.drugStore.enums;

public enum ResultEnum {
    // 系统
    SUCCESS(1000, "操作成功"),
    ERROR(9999, "操作失败"),
    ERR_SERVER(9998, "系统异常"),
    ERR_NETWORK_NULL(9997, "网络异常，请稍后再试"),
    ERR_LOCK_LIMIT(9996, "请求频繁，请稍后再试"),
    ERR_PARAM_ERROR(9995, "参数异常"),
    ERR_TOKEN(9994, "登录过期，请重新登录"),
    ERR_NO_PERMISSION(9993, "无权限");


    private int code;
    private String message;

    ResultEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return String.format("result code [%s] message [%s]", code, message);
    }
}
